import request from '@/utils/request'

export function getLinkInfo(linkName: string) {
  return request({
    url: '/admin/link/getInfo?linkName=' + linkName,
    method: 'get'
  })
}

export function deleteLinkById(linkId: number) {
  return request({
    url: '/admin/link/deleteById/' + linkId,
    method: 'delete'
  })
}

export function getLinkById(linkId: number) {
  return request({
    url: '/admin/link/getById/' + linkId,
    method: 'get'
  })
}

export function update(link: object) {
  return request({
    url: '/admin/link/updateLink',
    method: 'put',
    data: link
  })
}

export function insert(link: object) {
  return request({
    url: '/admin/link/insertLink',
    method: 'post',
    data: link
  })
}
